package pl.edu.agh.io.gpstracker.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import pl.edu.agh.io.gpstracker.model.Messages;

/**
 * 
 * @author wkedzior
 * 
 */
@Repository
public class MessageDaoImpl extends GenericDaoImpl<Messages, Long> implements
		MessageDao {

	public MessageDaoImpl() {
		super(Messages.class);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Messages> getMessageByUserId(Integer userId) {
		return getHibernateTemplate()
				.find(
						"from pl.edu.agh.io.gpstracker.model.Messages where userId  = ? ",
						new Object[] { userId });
	}
}
